Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Oct 30, 2025

Adds an optional parameter with enclosingControls: [DiagnosticGroupIdentifier: WarningGroupBehavior] = [:] to both:

  • SyntaxProtocol.warningGroupControlRegionTree
  • SyntaxProtocol.warningGroupBehavior to specify enclosing global warning group behavior controls which span the entire syntax node.

This mechanism will be used by the compiler to specify global controls over certain diagnostic groups from the compilation configuration. For example, a command-line-specified -Werror Group will become an input to this mechanism to be used as the behavior control at source positions where no syntactic control (@warn) is specified.

With this in place, the SwiftWarningControl API can be used as a single query which captures both syntactic and command-line configuration of warning diagnostic group behavior.

@artemcm
Copy link
Contributor Author

artemcm commented Oct 30, 2025

@swift-ci test

@artemcm artemcm force-pushed the WarningControl-EnclosingControls branch from 0c5dd9b to 59c2431 Compare October 30, 2025 17:53
@artemcm
Copy link
Contributor Author

artemcm commented Oct 30, 2025

@swift-ci test

@artemcm artemcm force-pushed the WarningControl-EnclosingControls branch from 59c2431 to c05eac6 Compare October 30, 2025 17:57
@artemcm
Copy link
Contributor Author

artemcm commented Oct 31, 2025

@swift-ci test

@artemcm artemcm force-pushed the WarningControl-EnclosingControls branch from c05eac6 to ac0b0d1 Compare October 31, 2025 15:10
…luding client-specified enclosing control rules

Adds an optional parameter `with enclosingControls: [DiagnosticGroupIdentifier: WarningGroupBehavior] = [:]` to both:
- `SyntaxProtocol.warningGroupControlRegionTree`
- `SyntaxProtocol.warningGroupBehavior`
to specify enclosing global warning group behavior controls which span the entire syntax node.

This mechanism will be used by the compiler to specify global controls over certain diagnostic groups from the compilation configuration. For example, a command-line-specified `-Werror Group` will become an input to this mechanism to be used as *the* behavior control at source positions where no syntactic control (`@warn`) is specified.

With this in place, the `SwiftWarningControl` API can be used as a single query which captures both syntactic and command-line configuration of warning diagnostic group behavior.
@artemcm artemcm force-pushed the WarningControl-EnclosingControls branch from ac0b0d1 to 804df14 Compare October 31, 2025 15:13
@artemcm
Copy link
Contributor Author

artemcm commented Oct 31, 2025

@swift-ci test

@artemcm artemcm marked this pull request as ready for review October 31, 2025 15:23
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@ahoppen
Copy link
Member

ahoppen commented Nov 3, 2025

@swift-ci Please test Windows

@artemcm artemcm merged commit 90e6d96 into swiftlang:main Nov 3, 2025
61 of 69 checks passed
@artemcm artemcm deleted the WarningControl-EnclosingControls branch November 3, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants